<?php

namespace app\listener\pay;

use app\event\PaySuccess;
use app\model\CouponOrder;

/**
 * 成功过之后提交供应商
 */
class SupplierSubmit
{
    /**
     * 事件监听处理
     * @param PaySuccess $event
     * @return mixed
     */
    public function handle($event)
    {
        $payLog = $event->obj;
        /**
         * @var CouponOrder $couponOrder
         */
        $couponOrder = $payLog->couponOrder;
        //等待提交供应商
        $couponOrder->supplier_status = CouponOrder::SUPPLIER_STATUS_WAIT;
        $couponOrder->save();

    }
}